﻿using System;
using System.Collections.Generic;
using System.Text;
using System.Data;
using CNVP.Framework.Helper;

namespace CNVP.JShop.BLL
{
    public class CNVP_Ads
    {
        DAL.CNVP_Ads dal = new DAL.CNVP_Ads();

        #region BLL
        #region 添加
        /// <summary>
        /// 添加
        /// </summary>
        public int Add_CNVP_Ads(Model.CNVP_Ads obj, byte IsType)
        {
            return dal.Insert(obj, IsType);
        }
        #endregion

        #region 修改
        /// <summary>
        /// 修改
        /// </summary>
        public int Update_CNVP_Ads(Model.CNVP_Ads obj)
        {
            return dal.Update(obj);
        }

        #endregion

        #region 删除
        /// <summary>
        /// 删除
        /// </summary>
        public int Delete_CNVP_Ads(Model.CNVP_Ads obj)
        {
            return dal.Delete(obj);
        }

        /// <summary>
        /// 删除,生成列的主键列构成的参数列表
        /// </summary>
        public int Delete_CNVP_Ads(int ID)
        {
            return this.Delete_CNVP_Ads(new Model.CNVP_Ads()
            {

                ID = ID
            });
        }
        #endregion

        /// <summary>
        /// 查看单个
        /// </summary>
        public Model.CNVP_Ads GetSingle_CNVP_AdsById(int ID)
        {
            return dal.LoadById(ID);
        }
        /// <summary>
        /// 查看全部
        /// </summary>
        public List<Model.CNVP_Ads> GetAll_CNVP_Ads(string sqlWhere)
        {
            return dal.LoadAll(sqlWhere);
        }
        /// <summary>
        /// 查看前几条数
        /// </summary>
        /// <param name="top">数量</param>
        /// <param name="sqlWhere">条件</param>
        /// <returns></returns>
        public List<Model.CNVP_Ads> GetAll_CNVP_Ads(int topNum, string sqlWhere)
        {
            return dal.LoadAll(topNum, sqlWhere);
        }
        /// <summary>
        /// 查看全部
        /// </summary>
        public List<Model.CNVP_Ads> GetAll_CNVP_Ads()
        {
            return this.GetAll_CNVP_Ads("");
        }
        #endregion

        public DataTable GetPage(int PageIndex, int PageSize, out int RecordCount, out int PageCount, params SQLConditionInfo[] SqlCondition)
        {
            return dal.GetPage( PageIndex, PageSize, out RecordCount, out PageCount, SqlCondition);
        }

        public DataTable GetAdvanceAds(int PageIndex, int PageSize, out int RecordCount, out int PageCount, params SQLConditionInfo[] SqlCondition)
        {
            return dal.GetAdvanceAds(PageIndex, PageSize, out RecordCount, out PageCount, SqlCondition);
        }
        #region 通过时间戳获得数据
        public List<Model.CNVP_Ads> GetListForStamp(string dt1,string dt2, string wsql) {

            return dal.GetListForStamp(dt1, dt2, wsql);
        }
        public DataTable GetPageForStamp(int PageIndex, int PageSize, out int RecordCount, out int PageCount, params SQLConditionInfo[] SqlCondition)
        {
            return dal.GetPageForStamp(PageIndex, PageSize, out RecordCount, out PageCount, SqlCondition); 
        }
        #endregion
    }

}
